package com.elinkway.infinitemovies.http.requesttask;

import android.content.Context;

import com.elinkway.infinitemovies.async.MoviesHttpAsyncTask;
import com.elinkway.infinitemovies.async.RequestResultListener;
import com.elinkway.infinitemovies.bean.FeedbackQuestionBean;
import com.elinkway.infinitemovies.http.api.MoviesHttpApi;
import com.elinkway.infinitemovies.http.parser.FeedbackQurstionParser;
import com.lvideo.http.bean.LVideoDataHull;

/**
 * Created by huangxiaojian on 2017/8/1.
 */

public class RequestFeedbackQuestionTask extends MoviesHttpAsyncTask<FeedbackQuestionBean> {

    private RequestResultListener<FeedbackQuestionBean> mListener;

    public RequestFeedbackQuestionTask(Context context, RequestResultListener<FeedbackQuestionBean> listener) {
        super(context);
        mListener = listener;
    }

    @Override
    public LVideoDataHull<FeedbackQuestionBean> doInBackground() {
        LVideoDataHull<FeedbackQuestionBean> ret = MoviesHttpApi.requestFeedbackQuestion(
                new FeedbackQurstionParser());
        return ret;
    }

    @Override
    public void onPostExecute(int updateId, FeedbackQuestionBean result) {
        mListener.onRequestSuccess(updateId, result);
    }

}
